#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

void tulosta(pair<long int, string>i) {
	cout<< i.second<<endl;
}

void main() {

	map<long int, string> m;

	m[0] = "A";
	m[1] = "B";
	m[2] = "C";
	m[3] = "D";
	m[4] = "E";

	cout<<"Print list" <<endl;
	for_each (m.begin(), m.end(), tulosta);
	cout<<endl;

	cout<<"Print reverse_list" <<endl;
	for_each (map<long int, string>::reverse_iterator(m.end()), map<long int, string>::reverse_iterator(m.begin()), tulosta);
	cout<<endl;

	int input;
	cout << "Search: ";
	cin >> input;

	map<long int, string>::iterator it;
	it = m.find(input);
	cout<<"Print find"<<endl;
	tulosta(*it);
	cout<<endl;

}